(C) 1996 AROS - The Amiga Replacement OS


NAME
LONG SPCmp()
SYNOPSIS
LONG fnum1
LONG fnum2

LOCATION
In MathBase at offset 7
FUNCTION
Compares two ffp numbers

INPUTS
fnum1 - ffp number fnum2 - ffp number
RESULT
+1 : fnum1 > fnum2 0 : fnum1 = fnum2 -1 : fnum1 < fnum2

Flags: zero : fnum2 = fnum1 negative : fnum2 < fnum1 overflow : 0

NOTES
EXAMPLE
BUGS
SEE ALSO
INTERNALS
ALGORITHM: 1st case: fnum1 is negative and fnum2 is positive or ( exponent(fnum1) < exponent(fnum2) and signs are equal ) -> fnum1 < fnum2

2nd case: fnum1 is positive and fnum2 is negative or ( exponent(fnum1) > exponent(fnum2) and signs are equal ) -> fnum2 > fnum1

now the signs and exponents must be equal

3rd case: fnum1 == fnum2

4th case: mantisse(fnum1) < mantisse(fnum2) -> fnum1 < fnum2

final case: fnum1 > fnum2

HISTORY
25.06.1997 bergers
*** empty log message ***
30.05.1997 aros
*** empty log message ***